//
// Copyright (C) 2011 Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.101
//#include "stdafx.h"
#include "MultiStepPeriodCapletSwaptions.h"
using namespace Cephei::QL::Models::Marketmodels::Products::Multistep;
#include <gen/QL/Models/Marketmodels/CurveState.h>
#include <gen/QL/Models/Marketmodels/MarketModelMultiProductCashFlow.h>
#include <gen/QL/Instruments/StrikedTypePayoff.h>
#include <gen/QL/Models/Marketmodels/EvolutionDescription.h>
#include <gen/QL/Models/Marketmodels/Products/MultiProductMultiStep.h>
using namespace Cephei::QL::Models::Marketmodels;
using namespace Cephei::QL::Instruments;
using namespace Cephei::QL::Models::Marketmodels::Products;
#undef HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (Cephei::IVector<Double>^ rateTimes, Cephei::IVector<Double>^ forwardOptionPaymentTimes, Cephei::IVector<Double>^ swaptionPaymentTimes, Cephei::IVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ forwardPayOffs, Cephei::IVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ swapPayOffs, UInt64 period, UInt64 offset) : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
    CoVector<Double>^ _CrateTimes;
    CoVector<Double>^ _CforwardOptionPaymentTimes;
    CoVector<Double>^ _CswaptionPaymentTimes;
    CoVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ _CforwardPayOffs;
    CoVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ _CswapPayOffs;
    try
    {
#ifdef HANDLE
        _phMultiStepPeriodCapletSwaptions = NULL;
#endif
        CoVector<Double>^ _CrateTimes = safe_cast<CoVector<Double>^> (rateTimes);
        _CrateTimes->Lock();
        INativeVector<Double>^ _NCIrateTimes = _CrateTimes->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCrateTimes = safe_cast<CDoubleVector^>(_NCIrateTimes);
        std::vector<QuantLib::Time>& _rateTimes = static_cast<std::vector<QuantLib::Time>&> (_NCrateTimes->GetReference ());
        CoVector<Double>^ _CforwardOptionPaymentTimes = safe_cast<CoVector<Double>^> (forwardOptionPaymentTimes);
        _CforwardOptionPaymentTimes->Lock();
        INativeVector<Double>^ _NCIforwardOptionPaymentTimes = _CforwardOptionPaymentTimes->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCforwardOptionPaymentTimes = safe_cast<CDoubleVector^>(_NCIforwardOptionPaymentTimes);
        std::vector<QuantLib::Time>& _forwardOptionPaymentTimes = static_cast<std::vector<QuantLib::Time>&> (_NCforwardOptionPaymentTimes->GetReference ());
        CoVector<Double>^ _CswaptionPaymentTimes = safe_cast<CoVector<Double>^> (swaptionPaymentTimes);
        _CswaptionPaymentTimes->Lock();
        INativeVector<Double>^ _NCIswaptionPaymentTimes = _CswaptionPaymentTimes->getFeature (NativeFeature::Value);
        CDoubleVector^ _NCswaptionPaymentTimes = safe_cast<CDoubleVector^>(_NCIswaptionPaymentTimes);
        std::vector<QuantLib::Time>& _swaptionPaymentTimes = static_cast<std::vector<QuantLib::Time>&> (_NCswaptionPaymentTimes->GetReference ());
        _CforwardPayOffs = safe_cast<CoVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^> (forwardPayOffs);
        _CforwardPayOffs ->Lock ();
        INativeVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ _NCIforwardPayOffs = _CforwardPayOffs->getFeature (NativeFeature::shared_ptr);
        CStrikedTypePayoffVector^ _NCforwardPayOffs = safe_cast<CStrikedTypePayoffVector^>(_NCIforwardPayOffs);
        std::vector<boost::shared_ptr<QuantLib::StrikedTypePayoff> >& _forwardPayOffs = static_cast<std::vector<boost::shared_ptr<QuantLib::StrikedTypePayoff> >&> (_NCforwardPayOffs->GetShared ());
        _CswapPayOffs = safe_cast<CoVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^> (swapPayOffs);
        _CswapPayOffs ->Lock ();
        INativeVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ _NCIswapPayOffs = _CswapPayOffs->getFeature (NativeFeature::shared_ptr);
        CStrikedTypePayoffVector^ _NCswapPayOffs = safe_cast<CStrikedTypePayoffVector^>(_NCIswapPayOffs);
        std::vector<boost::shared_ptr<QuantLib::StrikedTypePayoff> >& _swapPayOffs = static_cast<std::vector<boost::shared_ptr<QuantLib::StrikedTypePayoff> >&> (_NCswapPayOffs->GetShared ());
        QuantLib::Size _period = (QuantLib::Size)ValueHelper::Convert (period);
        QuantLib::Size _offset = (QuantLib::Size)ValueHelper::Convert (offset);
        _ppMultiStepPeriodCapletSwaptions = new boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions> (new QuantLib::MultiStepPeriodCapletSwaptions ( _rateTimes,  _forwardOptionPaymentTimes,  _swaptionPaymentTimes,  _forwardPayOffs,  _swapPayOffs,  _period,  _offset ));
        SetMultiProductMultiStep (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_CrateTimes != nullptr) _CrateTimes->Unlock();
        if (_CforwardOptionPaymentTimes != nullptr) _CforwardOptionPaymentTimes->Unlock();
        if (_CswaptionPaymentTimes != nullptr) _CswaptionPaymentTimes->Unlock();
        if (_CforwardPayOffs != nullptr) _CforwardPayOffs->Unlock();
        if (_CswapPayOffs != nullptr) _CswapPayOffs->Unlock();
    }
}
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions>& childNative, Object^ owner) : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
#ifdef HANDLE
	_phMultiStepPeriodCapletSwaptions = NULL;
#endif
	_ppMultiStepPeriodCapletSwaptions = &childNative;
    _ppMultiProductMultiStep = new boost::shared_ptr<QuantLib::MultiProductMultiStep> (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
}
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (QuantLib::MultiStepPeriodCapletSwaptions& childNative, Object^ owner) : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
#ifdef HANDLE
	_phMultiStepPeriodCapletSwaptions = NULL;
#endif
	_ppMultiStepPeriodCapletSwaptions = new boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions> (&childNative);
    _ppMultiProductMultiStep = new boost::shared_ptr<QuantLib::MultiProductMultiStep> (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
    _MultiStepPeriodCapletSwaptionsOwner = owner;
    _MultiProductMultiStepOwner = owner;
}

Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (CMultiStepPeriodCapletSwaptions^ copy) : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
#ifdef HANDLE
	_phMultiStepPeriodCapletSwaptions = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppMultiStepPeriodCapletSwaptions = new boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions> (copy->GetShared());
        _ppMultiProductMultiStep = new boost::shared_ptr<QuantLib::MultiProductMultiStep> (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
    }
}
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (System::Type^ t) : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
#ifdef HANDLE
	_phMultiStepPeriodCapletSwaptions = NULL;
#endif
	if (!t->IsSubclassOf(CMultiStepPeriodCapletSwaptions::typeid))
		throw gcnew Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (QuantLib::Handle<QuantLib::MultiStepPeriodCapletSwaptions>& childNative, Object^ owner)  : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
	_phMultiStepPeriodCapletSwaptions = &childNative;
	_ppMultiStepPeriodCapletSwaptions = &static_cast<boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions>>(childNative.currentLink());
    _ppMultiProductMultiStep = new boost::shared_ptr<QuantLib::MultiProductMultiStep> (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
    _MultiStepPeriodCapletSwaptionsOwner = owner;
}
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (QuantLib::Handle<QuantLib::MultiStepPeriodCapletSwaptions> childNative)  : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
	_phMultiStepPeriodCapletSwaptions = &childNative;
	_ppMultiStepPeriodCapletSwaptions = &static_cast<boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions>>(childNative.currentLink());
    _ppMultiProductMultiStep = new boost::shared_ptr<QuantLib::MultiProductMultiStep> (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
}
#endif
#ifdef STRUCT
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::CMultiStepPeriodCapletSwaptions (QuantLib::MultiStepPeriodCapletSwaptions childNative)  : CMultiProductMultiStep(CMultiStepPeriodCapletSwaptions::typeid)
{
#ifdef HANDLE
	_phMultiStepPeriodCapletSwaptions = NULL;
#endif
	_ppMultiStepPeriodCapletSwaptions = new boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions> (new QuantLib::MultiStepPeriodCapletSwaptions (childNative));
    _ppMultiProductMultiStep = new boost::shared_ptr<QuantLib::MultiProductMultiStep> (boost::dynamic_pointer_cast<QuantLib::MultiProductMultiStep> (*_ppMultiStepPeriodCapletSwaptions));
}
#endif

Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::~CMultiStepPeriodCapletSwaptions ()
{
    if (_ppMultiStepPeriodCapletSwaptions != NULL)
    {
	    delete _ppMultiStepPeriodCapletSwaptions;
        _ppMultiStepPeriodCapletSwaptions = NULL;
    }
}
Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::!CMultiStepPeriodCapletSwaptions ()
{
    if (_ppMultiStepPeriodCapletSwaptions != NULL)
    {
	    delete _ppMultiStepPeriodCapletSwaptions;
    }
}
QuantLib::MultiStepPeriodCapletSwaptions& Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::GetReference ()
{
    if (_ppMultiStepPeriodCapletSwaptions == NULL) throw gcnew NativeNullException ();
	return **_ppMultiStepPeriodCapletSwaptions;
}
boost::shared_ptr<QuantLib::MultiStepPeriodCapletSwaptions>& Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::GetShared ()
{
    if (_ppMultiStepPeriodCapletSwaptions == NULL) throw gcnew NativeNullException ();
	return *_ppMultiStepPeriodCapletSwaptions;
}
QuantLib::MultiStepPeriodCapletSwaptions* Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::GetPointer ()
{
    if (_ppMultiStepPeriodCapletSwaptions == NULL) throw gcnew NativeNullException ();
	return &**_ppMultiStepPeriodCapletSwaptions;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::MultiStepPeriodCapletSwaptions>& Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::GetHandle ()
{
	if (_phMultiStepPeriodCapletSwaptions == NULL)
	{
		_phMultiStepPeriodCapletSwaptions = new Handle<QuantLib::MultiStepPeriodCapletSwaptions> (*_ppMultiStepPeriodCapletSwaptions);
	}
	return *_phMultiStepPeriodCapletSwaptions;
}
#endif
bool Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::HasNative () 
{
	return (_ppMultiStepPeriodCapletSwaptions != NULL);
}

Boolean Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::NextTimeStep (Cephei::QL::Models::Marketmodels::ICurveState^ currentState, Cephei::IVector<UInt64>^ numberCashFlowsThisStep, Cephei::IMatrix<Cephei::QL::Models::Marketmodels::IMarketModelMultiProductCashFlow^>^ cashFlowsGenerated)
{
    CCurveState^ _CcurrentState;
    CoVector<UInt64>^ _CnumberCashFlowsThisStep;
    CoMatrix<Cephei::QL::Models::Marketmodels::IMarketModelMultiProductCashFlow^>^ _CcashFlowsGenerated;
    try
    {
    	boost::detail::spinlock::scoped_lock lock (*_pSpinlock);
        _CcurrentState = safe_cast<CCurveState^> (currentState);
        _CcurrentState->Lock();
        QuantLib::CurveState& _currentState = static_cast<QuantLib::CurveState&> (_CcurrentState->GetReference ()); 
        _CnumberCashFlowsThisStep = safe_cast<CoVector<UInt64>^> (numberCashFlowsThisStep);
        _CnumberCashFlowsThisStep->Lock();
        INativeVector<UInt64>^ _NCInumberCashFlowsThisStep = _CnumberCashFlowsThisStep->getFeature (NativeFeature::Value);
        CUInt64Vector^ _NCnumberCashFlowsThisStep = safe_cast<CUInt64Vector^>(_NCInumberCashFlowsThisStep);
        std::vector<QuantLib::Size>& _numberCashFlowsThisStep = static_cast<std::vector<QuantLib::Size>&> (_NCnumberCashFlowsThisStep->GetReference ());
        _CcashFlowsGenerated = safe_cast<CoMatrix<Cephei::QL::Models::Marketmodels::IMarketModelMultiProductCashFlow^>^> (cashFlowsGenerated);
        _CcashFlowsGenerated->Lock();
        INativeMatrix<Cephei::QL::Models::Marketmodels::IMarketModelMultiProductCashFlow^>^ _NCIcashFlowsGenerated = _CcashFlowsGenerated->getFeature (NativeFeature::Value);
        CMarketModelMultiProductCashFlowMatrix^ _NCcashFlowsGenerated = safe_cast<CMarketModelMultiProductCashFlowMatrix^>(_NCIcashFlowsGenerated);
        std::vector<std::vector<QuantLib::MarketModelMultiProductCashFlow> >& _cashFlowsGenerated = static_cast<std::vector<std::vector<QuantLib::MarketModelMultiProductCashFlow> >&> (_NCcashFlowsGenerated->GetReference ());
    	bool _rv = (bool)(*_ppMultiStepPeriodCapletSwaptions)->nextTimeStep ( _currentState,  _numberCashFlowsThisStep,  _cashFlowsGenerated );   
        Boolean _nrv = (Boolean)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
        if (_CcurrentState != nullptr) _CcurrentState->Unlock();
        if (_CnumberCashFlowsThisStep != nullptr) _CnumberCashFlowsThisStep->Unlock();
        if (_CcashFlowsGenerated != nullptr) _CcashFlowsGenerated->Unlock();
    }
}
UInt64 Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::MaxNumberOfCashFlowsPerProductPerStep::get ()
{
    try
    {
    	QuantLib::Size _rv = (QuantLib::Size)(*_ppMultiStepPeriodCapletSwaptions)->maxNumberOfCashFlowsPerProductPerStep ( );   
        UInt64 _nrv = (UInt64)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
UInt64 Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::NumberOfProducts::get ()
{
    try
    {
    	QuantLib::Size _rv = (QuantLib::Size)(*_ppMultiStepPeriodCapletSwaptions)->numberOfProducts ( );   
        UInt64 _nrv = (UInt64)ValueHelper::Convert (_rv);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::IVector<Double>^ Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::PossibleCashFlowTimes::get ()
{
    try
    {
    	std::vector<QuantLib::Time> _rv = (std::vector<QuantLib::Time>)(*_ppMultiStepPeriodCapletSwaptions)->possibleCashFlowTimes ( );   
        Cephei::IVector<Double>^ _nrv = gcnew CoVector<Double> (gcnew CDoubleVector (_rv));
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Models::Marketmodels::Products::Multistep::IMultiStepPeriodCapletSwaptions^ Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions::Reset::get ()
{
    try
    {
    	boost::detail::spinlock::scoped_lock lock (*_pSpinlock);
    	(*_ppMultiStepPeriodCapletSwaptions)->reset ( );
    	return this;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw gcnew NativeExcpetion (gcnew System::String(_error.what()));
        else
		    throw gcnew NativeExcpetion (gcnew System::String("Unknown std::exception"));
	}
    finally
    {
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

Cephei::QL::Models::Marketmodels::Products::Multistep::IMultiStepPeriodCapletSwaptions^ Cephei::QL::Models::Marketmodels::Products::Multistep::CMultiStepPeriodCapletSwaptions_Factory::Create (Cephei::IVector<Double>^ rateTimes, Cephei::IVector<Double>^ forwardOptionPaymentTimes, Cephei::IVector<Double>^ swaptionPaymentTimes, Cephei::IVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ forwardPayOffs, Cephei::IVector<Cephei::QL::Instruments::IStrikedTypePayoff^>^ swapPayOffs, UInt64 period, UInt64 offset)
{
    return gcnew CMultiStepPeriodCapletSwaptions ( rateTimes,  forwardOptionPaymentTimes,  swaptionPaymentTimes,  forwardPayOffs,  swapPayOffs,  period,  offset);
}
